﻿using System;
using System.Collections.Generic;

namespace BackEndProcessorInterface
{
    class ProcessorFlag: ICloneable
    {
        private readonly List<bool> Option;      

        public ProcessorFlag()
        {
            Option = new List<bool>();
            Option[0] = false;
        }
        public ProcessorFlag(params bool[] oparam)
        {
            Option = new List<bool>();
            var inum = oparam.GetEnumerator();
            while (inum.MoveNext())
            {
                Option.Add((bool)inum.Current);
            }            
        }        
        public bool this[int index]
        {
            get { return Option[index]; }
            set { Option[index] = value; }
        }
        public int _Count
        {
            get { return Option.Count; }
        }
        public void Drop()
        {
            for (int i = 0; i < _Count; i++)
                this[i] = false;
        }
        public bool[] toArray
        {
            get { return Option.ToArray(); }
        }
        public override string ToString()
        { 
            string toString = null;
            var inum = Option.GetEnumerator();
            while (inum.MoveNext())
                toString += inum.Current + "\t";

            return toString;
        }
        public object Clone()
        {
            return new ProcessorFlag(toArray);
        }
    }
}
